#!/bin/dash

usage() { echo "Usage: recomp {path1,path2,...}" ; exit 1 ; }

[ $# -eq 0 ] && usage

ROOTID="0"

if [ "$(id -u)" -ne "$ROOTID" ]; then
    echo "no root privileges"
    exit 1
fi

for path ; do

    echo "processing $path" 1>&2
    cd "$path" || usage
    make clean &&
    make install || exit 1

done > /dev/null
